package com.jsnj33.pdaproject.utils;/**
 * 作者:33oa李国平 on 2017/4/1011:14
 */

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by 33oa on 2017/4/10.
 */
public class MyDateUtils {

    /**
     * 获取当前时间
     * @return
     */
    public static String getCurrentFormatDate() {
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date();
        String format = sf.format(date);
        return format;
    }

    public static String millisecondToDate(long data){
        SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date=new Date(data);
        String format = sd.format(date);
        return format;
    }
    public static String millisecondToDate2(long data){
        SimpleDateFormat sd = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
        Date date=new Date(data);
        String format = sd.format(date);
        return format;
    }

    public static String millisecondToDate3(long data){
        SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
        Date date=new Date(data);
        String format = sd.format(date);
        return format;
    }

    public static long getCurrentTime(){
        Date dt= new Date();
        long time = dt.getTime();
        return time;
    }
}
